<template>
<!--  整改报告-->
  <div class="zgbg">
    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="60px">
      <el-row style="margin-top: 25px" v-if="status!=='read'">
        <el-col :span="6">
          <el-form-item label="经办人：" label-width="90px">
            <el-input v-model="ruleForm.shenbaoren" placeholder="请输入" suffix-icon="el-icon-user" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="经办日期：" label-width="90px">
            <el-date-picker
              v-model="ruleForm.riqi"
              type="date"
              placeholder="选择日期"
              :readonly="status==='read'"
              style="width: 100%">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="经办部门：" label-width="90px">
            <el-input v-model="ruleForm.bumen" placeholder="请输入" suffix-icon="el-icon-c-scale-to-original" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="N：">
            <el-input v-model="ruleForm.N" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row v-if="status!=='read'">
        <el-form-item label="经办单位：" label-width="90px">
          <el-input v-model="ruleForm.danwei" placeholder="请输入" suffix-icon="el-icon-office-building" :readonly="status==='read'"></el-input>
        </el-form-item>
      </el-row>
      <div class="form-small-title">
        <el-divider direction="vertical" class="form-divider"></el-divider>
        <span class="form-small-font">通知信息</span>
      </div>
      <el-row style="margin-top: 25px">
        <el-col :span="12">
          <el-form-item label="项目名称：" label-width="100px">
            <el-input v-model="ruleForm.xmmc" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="项目编号：" label-width="90px">
            <el-input v-model="ruleForm.xmbh" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="负责人：" label-width="90px" v-if="status==='edit'">
            <el-input v-model="ruleForm.fzr" placeholder="请输入" suffix-icon="el-icon-user" :readonly="status==='read'"></el-input>
          </el-form-item>
          <el-form-item label="项目部门：" label-width="90px" v-if="status==='add'">
            <el-input v-model="ruleForm.xmbm" placeholder="请输入" suffix-icon="el-icon-user" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="整改原因：" label-width="100px">
            <el-input v-model="ruleForm.zgyy" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="整改要求：" label-width="90px">
            <el-input v-model="ruleForm.zgyq" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="整改责任人：" label-width="100px">
            <el-input v-model="ruleForm.zgzrr" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="整改期限：" label-width="90px">
            <el-input v-model="ruleForm.zgqx" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="相关附件：" label-width="90px">
            <el-input v-model="ruleForm.fujian" placeholder="请输入" suffix-icon="el-icon-paperclip" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <div class="form-small-title" v-if="status==='edit'">
        <el-divider direction="vertical" class="form-divider"></el-divider>
        <span class="form-small-font">整改结果</span>
      </div>
      <el-row style="margin-top: 25px" v-if="status==='edit'">
          <el-form-item label="整改说明：" label-width="100px">
            <el-input v-model="ruleForm.shuoming" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
      </el-row>
      <el-row v-if="status==='edit'">
          <el-form-item label="相关附件：" label-width="100px">
            <el-input v-model="ruleForm.fujian" placeholder="请输入" suffix-icon="el-icon-paperclip" :readonly="status==='read'"></el-input>
          </el-form-item>
      </el-row>
      <div class="form-small-title" v-if="status==='read'">
        <el-divider direction="vertical" class="form-divider"></el-divider>
        <span class="form-small-font">整改审核</span>
      </div>
      <el-row style="margin-top: 25px" v-if="status==='read'">
        <el-col :span="6">
          <el-form-item label="审核人：" label-width="100px">
            <el-input v-model="ruleForm.shenheren" placeholder="请输入" :readonly="status==='read'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="整改完成：" label-width="100px">
            <el-radio-group v-model="ruleForm.radio" placeholder="请选择" :disabled="status==='read'">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="完成日期：" label-width="90px">
            <el-date-picker
              v-model="ruleForm.wancheng"
              type="date"
              placeholder="选择日期"
              :readonly="status==='read'"
              style="width: 100%">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "zgbg",
  data(){
    return{
      ruleForm:{},
      rules:{},
    }
  },
  props:{
    status:{
      type: String,
      default:''
    },
    selectRow:{
      type: Object,
      default: ()=>{}
    }
  },
  watch:{
    selectRow:{
      handler(val) {
        if(this.selectRow){
          this.ruleForm.xmmc = this.selectRow.projectName
          this.ruleForm.zgqx = this.selectRow.time
          this.ruleForm.zgyy = this.selectRow.cause
          this.ruleForm.zgyq = this.selectRow.request
        }
      },
      immediate: true,
    }
  }
}
</script>

<style scoped lang="scss">
.zgbg ::v-deep{
  .el-input__inner {
    border: 0 !important;
    border-bottom: 1px solid #DCDFE6 !important;
    border-radius: 0 !important;
    padding-right: 20px !important;
  }
}
.form-small-title{
  border-bottom: solid 2px #C0C4CC;
  padding-bottom: 10px;
}
.form-divider{
  width: 5px;
  height: 26px;
  background: rgb(66, 185, 131);
}
.form-small-font{
  font-size: 19px;
  font-weight: 600;
  color: #303133;
}
</style>
